package com.mingben.betplatform.enums;

/**
 * 下注单位　4 厘　3 分　2 角　1　元
 */
public enum MoneyUnit {
    YUAN("元","1"),
    JIAO("角","2"),
    FEN("分","3"),
    LI("厘","4");

    private String name ;
    private String code;
    MoneyUnit(String name , String code){
        this.name = name;
        this.code = code;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static MoneyUnit getByName(String name){
        for(MoneyUnit unit : MoneyUnit.values()){
            if(unit.getName().equals(name)){
                return  unit;
            }
        }
        return null;
    }
}
